<script language='javascript' type='text/javascript' src="<?=base_url('block')?>scripts/block.js"></script>
<?php echo form_open($this->block_list_model->url_prefix); ?>
<center><?if($msg){?><div class="messageBox"><?=$msg?></div><?}?>
Block Type Filter: <?=Modules::run('block_type.block_type.dropdown')?>
</center>
<table width="100%" border="0" align="center" cellpadding="1" cellspacing="1" class="text">
  <tr align="center" id="listTableHeader"> 
	<td width="30"><a href="javascript:block.sortColumn(<?=$start?>, 'id')"{sort_id}>#</a></td>
    <td width="15"><input type="checkbox" onclick="common.mark_all_rows('uid[]', this.checked)" /></td>
    <td><a href="javascript:block.sortColumn(<?=$start?>, 'name')"{sort_name}>Name</a></td>
	<td><?php if ($this->block_list_model->cache->load($this->block_list_model->filter_cache_prefix)=='SI') { ?><a href="javascript:block.sortColumn(<?=$start?>, 'obj_id')"{sort_obj_id}>Image<?php } else {?><a href="javascript:block.sortColumn(<?=$start?>, 'content')"{sort_content}>Content<?php }?></td>
    <td width="60">Action</td>
  </tr>
<? $i=1;foreach($items as $item){?>
  <tr class="row<?=($i==1)?'1':'2'?>">
	<td><?=$item->{BLOCK_BLOCK_ID}?></td>
    <td><input type="checkbox" name="uid[]" value="<?=$item->{BLOCK_BLOCK_ID}?>" /></td>
    <td><?=h($item->{BLOCK_NAME})?></td>
	<td>
		<?php if ($item->{BLOCK_OBJ_ID}) {?>
		<a href="<?=site_url('admin/image.image.detail/0/'.$item->{BLOCK_OBJ_ID})?>"><img src="<?=base_url().$this->display_image_model->thumbnail($item->{BLOCK_OBJ_ID})?>" border="0" /></a>
		<? } else echo h($item->{BLOCK_CONTENT}); ?>
	</td>
    <td>
        <a href="javascript:if(block.validate()) common.go_page('<?=($this->block_list_model->url_prefix2.'/'.$start.'/'.$item->{BLOCK_BLOCK_ID})?>')"><div class="edit_icon">|</div></a>
        <a href="javascript:block.deleteOne(<?=$start?>, <?=$item->{BLOCK_BLOCK_ID}?>);"><div class="delete_icon"></div></a>
    </td>
  <tr>
<? $i=-$i;} ?>
  <tr>
    <td colspan="5">
	<? if ($items) { if ($paging) { ?>
      <table class="adminlist" border="0" cellpadding="0" cellpadding="0" width="100%" class="PagingTable">
        <tr>
          <td class="pageCounter" width="100%" align="center">
            {paging}
          </td>
        </tr>
      </table>
	<? }} else { ?>
		<br />
		<?=$this->lang->line('not_found')?>
	<? } ?>
    </td>
  </tr>
</table>
</form>